/*
 * *****************************************************************************************
 *
 * 		Copyright (C) 2014-2019 Gowin Semiconductor Technology Co.,Ltd.
 *
 * @file		uart_app.c
 * @author		Embedded Development Team
 * @version		V1.0.0
 * @date		2019-10-1 09:00:00
 * @brief
 ******************************************************************************************
 */

#include "gw1ns4c.h"
#include "uart_app.h"


void _putchar(char character)
{
	UART_SendChar(UART_CONSOLE, character);
}

void uart_app_init(uint32_t baudrate)
{
	UART_InitTypeDef UART_InitStruct;

	UART_InitStruct.UART_Mode.UARTMode_Tx = ENABLE;
	UART_InitStruct.UART_Mode.UARTMode_Rx = ENABLE;
	UART_InitStruct.UART_Int.UARTInt_Tx = DISABLE;
	UART_InitStruct.UART_Int.UARTInt_Rx = DISABLE;
	UART_InitStruct.UART_Ovr.UARTOvr_Tx = DISABLE;
	UART_InitStruct.UART_Ovr.UARTOvr_Rx = DISABLE;
	UART_InitStruct.UART_Hstm = DISABLE;
	UART_InitStruct.UART_BaudRate = baudrate;

	UART_Init(UART_CONSOLE, &UART_InitStruct);
	//UART_Init(UART1, &UART_InitStruct);
	//UART_Init(UART2, &UART_InitStruct);
	//UART_Init(UART3, &UART_InitStruct);
}

/*********************************************************************************************************
END FILE
*********************************************************************************************************/
